package com.springBoot.springBootSysCore.modules.controller.api.system;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.springBoot.springBootSysCore.modules.controller.web.base.BaseController;
import com.springBoot.springBootSysCore.modules.entity.system.SysCode;
import com.springBoot.springBootSysCore.modules.entity.system.SysFaq;
import com.springBoot.springBootSysCore.modules.enums.base.DeleteStateEnum;
import com.springBoot.springBootSysCore.modules.services.system.SysCodeService;
import com.springBoot.springBootSysCore.modules.services.system.SysFaqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 *系统参数
 */
@RestController
@RequestMapping("${apiPath}/auth/sysCode")
public class SysCodeControllerApi extends BaseController<SysCode,String> {
    @Autowired
    private SysCodeService sysCodeService;

    @RequestMapping(value="query",method= RequestMethod.POST)
    public Object queryByPage(HttpServletRequest request,
                              @RequestParam(required = false ,defaultValue = "1")int pageNumber,
                              @RequestParam(required = false ,defaultValue = "10")int pageSize,
                              SysCode entity,
                              Model model) throws JsonProcessingException{
        return sysCodeService.getCode(entity);
    }

    @RequestMapping(value="queryVideoLive",method= RequestMethod.POST)
    public Object queryVideoLive(HttpServletRequest request,
                              @RequestParam(required = false ,defaultValue = "1")int pageNumber,
                              @RequestParam(required = false ,defaultValue = "10")int pageSize,
                              SysCode entity,
                              Model model) throws JsonProcessingException{
        return sysCodeService.queryVideoLive();
    }

    @RequestMapping(value="queryForUs",method= RequestMethod.POST)
    public Object queryForUs() throws JsonProcessingException{
        return sysCodeService.queryForUs();
    }
}
